package controllers

import (
	"gin-worked/app/system/service"
	"gin-worked/work"
	"github.com/gin-gonic/gin"
)

type FileController struct {
}

func (f FileController) Upload(c *gin.Context) {
	file, err := c.FormFile("file")

	if err != nil {
		work.ReturnResult(c, 0, err, "")
	}

	res := service.Upload(c, file)
	work.ReturnResult(c, res.Code, res.Msg, res.Data)
	return
}
